package com.liujun.spring4.demo.aop.iocset.xmlset.collection;

import com.liujun.spring4.demo.aop.iocset.xmlset.refbean.Boss;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
 * 进行工厂方法测试
 *
 * @author liujun
 * @version 1.0
 * @date 2018-08-16 17:33:00
 */
public class BeanP {

  private ApplicationContext context;

  @BeforeClass
  private void start() {
    context =
        new ClassPathXmlApplicationContext("com/liujun/spring4/demo/aop/iocset/xmlset/collection/beanp.xml");
  }

  @Test
  public void getBoss() {
    Boss boss = (Boss) context.getBean("boss");
    System.out.println(boss);
    Assert.assertNotNull(boss);
  }
}
